package com.ruoyi;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * 启动程序
 *
 * @author piesat
 */
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class},scanBasePackages = {"com.ruoyi"})
@Slf4j
@EnableAsync
@EnableScheduling
@EnableTransactionManagement
public class PiesatWebServerApplication {

    public static void main(String[] args) {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(PiesatWebServerApplication.class, args);
        log.info("piesat-webServer 启动成功!");
        log.info("piesat-webServer 启动成功!");
        log.info("piesat-webServer 启动成功!");
    }

    //@Bean
    //public TomcatServletWebServerFactory containerFactory() {
    //    return new TomcatServletWebServerFactory() {
    //        @Override
    //        protected void customizeConnector(Connector connector) {
    //            int maxSize = 50000000;
    //            super.customizeConnector(connector);
    //            connector.setMaxPostSize(maxSize);
    //            connector.setMaxSavePostSize(maxSize);
    //            connector.setProperty("relaxedQueryChars", "[]{}");
    //            if (connector.getProtocolHandler() instanceof AbstractHttp11Protocol) {
    //                ((AbstractHttp11Protocol<?>) connector.getProtocolHandler()).setMaxSwallowSize(maxSize);
    //                logger.info("Set MaxSwallowSize "+ maxSize);
    //            }
    //        }
    //    };
    //}
}
